package com.skyline.energy.transaction;

public class TransactionContext {
	private boolean hasRollback;
	private boolean rollbackOnly = false;
	private boolean complete;
	private final TransactionManager txManager;
	private TransactionDefinition currentDefinition;
	
	public TransactionContext(TransactionManager manager) {
		this.txManager = manager;
	}
	
	public TransactionDefinition getCurrentDefinition() {
		return currentDefinition;
	}

	public void setCurrentDefinition(TransactionDefinition currentDefinition) {
		this.currentDefinition = currentDefinition;
	}

	public boolean hasRollback() {
		return hasRollback;
	}

	public void setHasRollback(boolean hasRollback) {
		this.hasRollback = hasRollback;
	}

	public void setRollbackOnly(boolean rollbackOnly) {
		this.rollbackOnly = rollbackOnly;
	}
	
	public boolean isRollbackOnly() {
		return rollbackOnly;
	}

	public TransactionManager getTxManager() {
		return txManager;
	}

	public boolean isComplete() {
		return complete;
	}

	public void setComplete(boolean complete) {
		this.complete = complete;
	}

}
